package org.shj.spark.core

import org.apache.spark.SparkConf
import org.apache.spark.SparkContext

object RDDFromCollection {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf
    conf.setAppName("RDDFromCollection")
    conf.setMaster("local")
    val sc = new SparkContext(conf)
    
    val nums = 1 to 100
    val rdd = sc.parallelize(nums)
    val i = rdd.reduce(_+_)
    println(i)
  }
}